package edu.gdkm;

import edu.gdkm.controller.UserController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Component;
@Component("testA")
class TestA {

    @Autowired
    private TestB testB;
    public void show(){
        testB.show();
    }

}
@Component("testB")
class TestB {

    @Autowired
    private TestA testA;
    public void show(){
        testA.show();
    }

}
public class AutoWiredTest {
    public static void main(String[] args) {
        ApplicationContext applicationContext=new
                ClassPathXmlApplicationContext("applicationContext.xml");
        TestA testA=(TestA)
                applicationContext.getBean("testA");
        testA.show();
    }
}